<?php

/**
 * ContractType form.
 *
 * @package    erp-dnict
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ContractTypeForm extends BaseContractTypeForm
{
  public function configure()
  {
    $this->setWidgets(array(
        'name'                  =>  new sfWidgetFormInput(),
        'duration'              =>  new sfWidgetFormInput(),
        'description'           =>  new sfWidgetFormTextarea(),
        'is_active'             =>  new sfWidgetFormInputCheckbox(),
    ));

    $this->widgetSchema->setLabels(array(
        'name'                  =>  'Tên hợp đồng:*',
        'duration'              =>  'Thời hạn hợp đồng:*',
        'description'           =>  'Ghi chú:',
        'is_active'             =>  'Khả dụng:',
    ));

    $this->setValidators(array(
        'name'                  =>  new sfValidatorString(array('required' => true)),
        'duration'              =>  new sfValidatorString(array('required' => true)),
        'description'           =>  new sfValidatorString(array('required' => false)),
        'is_active'             =>  new sfValidatorBoolean(),
    ));
    $this->widgetSchema->setNameFormat('contract_type[%s]');
  }
}
